<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>员工列表</title>

    <!--引入JQuery 注意在bootstrap.min.js之前引入，因为bootstrap基于jQuery-->
    <script type="text/javascript" th:src="@{/static/js/jquery-3.6.0.min.js}"></script>

    <!--引入bootstrap样式-->
    <link rel="stylesheet" th:href="@{/static/bootstrap-3.4.1-dist/css/bootstrap.min.css}">
    <script th:src="@{/static/bootstrap-3.4.1-dist/js/bootstrap.min.js}"></script>
    <script th:src="@{/static/js/vue.min.js}"></script>
</head>
<body>
<!--/*@thymesVar id="pageInfo" type="com.github.pagehelper.PageInfo"*/-->
<div id="app" class="container">
    <!--标题-->
    <div class="row">
        <div class="col-md-12 col-xs-12">
            <h1>SSM-CRUD</h1>
        </div>
    </div>

    <!--按钮-->
    <div class="row">
        <div class="col-md-4 col-md-offset-8 col-xs-4 col-xs-offset-8">
            <button class="btn btn-primary">新增</button>
            <button class="btn btn-danger">删除</button>
        </div>
    </div>
    <!--表格-->
    <div class="row">
        <div class="row">
            <div class="col-md-12 col-xs-12">
                <table class="table table-hover">
                    <tr>
                        <th>id</th>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>邮箱</th>
                        <th>操作</th>
                    </tr>

                    <tr th:each="emp : ${pageInfo.list}">
                        <td th:text="${emp.empId}"></td>
                        <td th:text="${emp.empName}"></td>
                        <td th:text="${emp.gender}"></td>
                        <td th:text="${emp.email}"></td>
                        <td>
                            <button type="button" class="btn btn-primary btn-sm">
                                <span class="glyphicon glyphicon-pencil"></span>
                                编辑
                            </button>
                            <button type="button" class="btn btn-primary btn-sm">
                                <span class="glyphicon glyphicon-trash"></span>
                                删除
                            </button>
                        </td>
                    </tr>

                </table>
            </div>
        </div>

        <!--记录信息-->
        <div class="col-md-6 col-xs-6">
            第 <span th:text="${pageInfo.pageNum}"></span> 页, 共 <span th:text="${pageInfo.pages}"></span> 页, 共
            <span th:text="${pageInfo.total}"></span> 条记录
        </div>
        <!--分页条信息-->
        <div class="col-md-6 col-xs-6">
            <ul class="pagination">
                <li><a th:href="@{/emps(pageNumber=1)}" th:hidden="${pageInfo.isFirstPage}">首页</a></li>
                <li><a th:href="@{/emps(pageNumber=${pageInfo.pageNum - 1})}"
                       th:hidden="${pageInfo.isFirstPage}">&laquo;</a></li>
                <th th:each="num : ${pageInfo.navigatepageNums}">
                    <li th:classappend="${num == pageInfo.pageNum} ? 'active' : '' "><a
                            th:href="@{/emps(pageNumber=${num})}" th:text="${num}"></a></li>
                </th>
                <li><a th:href="@{/emps(pageNumber=${pageInfo.pageNum + 1})}"
                       th:hidden="${pageInfo.isLastPage}">&raquo;</a></li>
                <li><a th:href="@{/emps(pageNumber=${pageInfo.pages})}"
                       th:hidden="${pageInfo.isLastPage}">末页</a></li>
            </ul>
        </div>
    </div>

</div>


<script>
    const app = new Vue({
        el: "#app",
        methods: {
            a_first: () => {
                alert("hello")
            }
        }
    })
</script>
</body>
</html>